﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExportToDWGTool
{
    class Typeutils
    {
       static public int getInt(String name, String type)
        {
            int lx = 0;
            switch (type)
            {
                //region----管孔类型----
                case "管孔类型":
                    switch (name)
                    {
                        case "空排管":
                            lx = 1;
                            break;
                        case "穿孔电缆":
                            lx = 2;
                            break;
                        case "直埋电缆":
                            lx = 3;
                            break;
                        case "穿孔低压":
                            lx = 4;
                            break;
                        case "直埋通讯":
                            lx = 5;
                            break;
                        case "穿孔通讯":
                            lx = 6;
                            break;
                        case "直埋低压":
                            lx = 7;
                            break;
                    }
                    break;
                //endregion
                //region----管孔材质----
                case "管孔材质":
                    switch (name)
                    {
                        case "PVC":
                            lx = 1;
                            break;
                        case "PE":
                            lx = 2;
                            break;
                        case "波纹管":
                            lx = 3;
                            break;
                        case "水泥管":
                            lx = 4;
                            break;
                        case "钢管":
                            lx = 5;
                            break;
                        case "铸铁":
                            lx = 6;
                            break;
                        case "复合":
                            lx = 7;
                            break;
                        case "未知":
                            lx = 8;
                            break;
                        case "砼":
                            lx = 9;
                            break;
                    }
                    break;
                //endregion
                //region----管孔孔径----
                case "管孔孔径":
                    switch (name)
                    {
                        case "200mm":
                            lx = 1;
                            break;
                        case "150mm":
                            lx = 2;
                            break;
                        case "100mm":
                            lx = 3;
                            break;
                        case "50mm":
                            lx = 4;
                            break;
                    }
                    break;
                //endregion
                //region----电压类型----
                case "电压类型":
                    switch (name)
                    {
                        case "高压":
                            lx = 1;
                            break;
                        case "中压":
                            lx = 2;
                            break;
                        case "低压":
                            lx = 3;
                            break;
                    }
                    break;
                //endregion
                //region----电压等级----
                case "电压等级":
                    switch (name)
                    {
                        case "交流10kV":
                            lx = 1;
                            break;
                        case "交流20kV":
                            lx = 2;
                            break;
                        case "交流35kV":
                            lx = 3;
                            break;
                        case "交流110kV":
                            lx = 4;
                            break;
                        case "交流220kV":
                            lx = 5;
                            break;
                        case "无":
                            lx = 6;
                            break;
                        case "光纤":
                            lx = 7;
                            break;
                        case "其他":
                            lx = 8;
                            break;
                        case "未定":
                            lx = 9;
                            break;
                    }
                    break;
                //endregion
                //region----变电站电压等级----
                case "变电站电压等级":
                    switch (name)
                    {
                        case "交流110kV":
                            lx = 4;
                            break;
                        case "交流35kV":
                            lx = 3;
                            break;
                        case "交流220kV":
                            lx = 5;
                            break;
                        case "其他":
                            lx = 8;
                            break;
                    }
                    break;
                //endregion
                //region----管沟状态----
                case "管沟状态":
                    switch (name)
                    {
                        case "未确认":
                            lx = 1;
                            break;
                        case "确认":
                            lx = 2;
                            break;
                    }
                    break;
                //endregion
                //region----是否----
                case "是否":
                    switch (name)
                    {
                        case "否":
                            lx = 1;
                            break;
                        case "是":
                            lx = 2;
                            break;
                    }
                    break;
                //endregion
                //region----有无----
                case "有无":
                    switch (name)
                    {
                        case "无":
                            lx = 1;
                            break;
                        case "有":
                            lx = 2;
                            break;
                    }
                    break;
                //endregion
                //region----管径材料----
                case "管径材料":
                    switch (name)
                    {
                        case "未定":
                            lx = 1;
                            break;
                        case "砼":
                            lx = 2;
                            break;
                        case "铁":
                            lx = 3;
                            break;
                        case "PVC":
                            lx = 4;
                            break;
                        case "维纶":
                            lx = 5;
                            break;
                        case "其他":
                            lx = 6;
                            break;
                    }
                    break;
                //endregion
                //region----管径----
                case "管径":
                    switch (name)
                    {
                        case "未定":
                            lx = 1;
                            break;
                        case "100mm":
                            lx = 2;
                            break;
                        case "150mm":
                            lx = 3;
                            break;
                        case "200mm":
                            lx = 4;
                            break;
                        case "250mm":
                            lx = 5;
                            break;
                        case "300mm":
                            lx = 6;
                            break;
                        case "其他":
                            lx = 7;
                            break;
                    }
                    break;
                //endregion
                //region----运行状态----
                case "运行状态":
                    switch (name)
                    {
                        case "在运":
                            lx = 1;
                            break;
                        case "运行":
                            lx = 2;
                            break;
                        case "设计":
                            lx = 3;
                            break;
                        case "施工":
                            lx = 4;
                            break;
                        case "备用":
                            lx = 5;
                            break;
                        case "退役":
                            lx = 6;
                            break;
                        case "其他":
                            lx = 7;
                            break;
                        case "未投运":
                            lx = 8;
                            break;
                        case "退运":
                            lx = 9;
                            break;
                        case "现场留用":
                            lx = 10;
                            break;
                        case "库存留用":
                            lx = 11;
                            break;
                        case "待报废":
                            lx = 12;
                            break;
                        case "报废":
                            lx = 13;
                            break;
                    }
                    break;
                //endregion
                //region----结构形式----
                case "结构形式":
                    switch (name)
                    {
                        case "未定":
                            lx = 1;
                            break;
                        case "砖混":
                            lx = 2;
                            break;
                        case "方沟":
                            lx = 3;
                            break;
                        case "单衬":
                            lx = 4;
                            break;
                        case "双衬":
                            lx = 5;
                            break;
                        case "盾构":
                            lx = 6;
                            break;
                        case "顶管":
                            lx = 7;
                            break;
                        case "其他":
                            lx = 8;
                            break;
                    }
                    break;
                //endregion
                //region----悬挂方式----
                case "悬挂方式":
                    switch (name)
                    {
                        case "未定":
                            lx = 1;
                            break;
                        case "支架":
                            lx = 2;
                            break;
                        case "涨圈":
                            lx = 3;
                            break;
                        case "挂钩":
                            lx = 4;
                            break;
                        case "其他":
                            lx = 5;
                            break;
                    }
                    break;
                //endregion
                //region----资产性质----
                case "资产性质":
                    switch (name)
                    {
                        case "国家电网公司":
                            lx = 1;
                            break;
                        case "区域电网公司":
                            lx = 2;
                            break;
                        case "省（直辖市、自治区）公司":
                            lx = 3;
                            break;
                        case "县公司":
                            lx = 4;
                            break;
                        case "用户":
                            lx = 5;
                            break;
                        case "股份制":
                            lx = 6;
                            break;
                    }
                    break;
                //endregion
                //region----专业类型----
                case "专业类型":
                    switch (name)
                    {
                        case "输电":
                            lx = 1;
                            break;
                        case "变电":
                            lx = 2;
                            break;
                        case "配电":
                            lx = 3;
                            break;
                    }
                    break;
                //endregion
                //region----通道数----
                case "通道数":
                    switch (name)
                    {
                        case "未定":
                            lx = 1;
                            break;
                        case "一通井":
                            lx = 2;
                            break;
                        case "二通井":
                            lx = 3;
                            break;
                        case "三通井":
                            lx = 4;
                            break;
                        case "四通井":
                            lx = 5;
                            break;
                        case "异形井":
                            lx = 6;
                            break;
                        case "其他":
                            lx = 7;
                            break;
                    }
                    break;
                //endregion
                //region----井盖材料----
                case "井盖材料":
                    switch (name)
                    {
                        case "未定":
                            lx = 1;
                            break;
                        case "球磨":
                            lx = 2;
                            break;
                        case "铁":
                            lx = 3;
                            break;
                        case "砼":
                            lx = 4;
                            break;
                        case "复合材料":
                            lx = 5;
                            break;
                        case "聚酯":
                            lx = 6;
                            break;
                        case "其他":
                            lx = 7;
                            break;
                    }
                    break;
                //endregion
                //region----井盖类型----
                case "井盖类型":
                    switch (name)
                    {
                        case "未定":
                            lx = 1;
                            break;
                        case "圆形":
                            lx = 2;
                            break;
                        case "方形":
                            lx = 3;
                            break;
                        case "其他":
                            lx = 4;
                            break;
                    }
                    break;
                //endregion
                case "拐点类型":
                    switch (name)
                    {
                        case "低压电子标签":
                            lx = 1;
                            break;
                        case "拐点":
                            lx = 2;
                            break;
                    }
                    break;
            }
            return lx;
        }

        static public String getString(int number, String type)
        {
            String name = "";
            switch (type)
            {
                //region---管孔类型----
                case "管孔类型":
                    switch (number)
                    {
                        case 1:
                            name = "空排管";
                            break;
                        case 2:
                            name = "穿孔电缆";
                            break;
                        case 3:
                            name = "直埋电缆";
                            break;
                        case 4:
                            name = "穿孔低压";
                            break;
                        case 5:
                            name = "直埋通讯";
                            break;
                        case 6:
                            name = "穿孔通讯";
                            break;
                        case 7:
                            name = "直埋低压";
                            break;
                    }
                    break;
                //endregion
                //region----管孔材质----
                case "管孔材质":
                    switch (number)
                    {
                        case 1:
                            name = "PVC";
                            break;
                        case 2:
                            name = "PE";
                            break;
                        case 3:
                            name = "波纹管";
                            break;
                        case 4:
                            name = "水泥管";
                            break;
                        case 5:
                            name = "钢管";
                            break;
                        case 6:
                            name = "铸铁";
                            break;
                        case 7:
                            name = "混合";
                            break;
                        case 8:
                            name = "未知";
                            break;
                    }
                    break;
                //endregion
                //region----管孔孔径----
                case "管孔孔径":
                    switch (number)
                    {
                        case 1:
                            name = "200mm";
                            break;
                        case 2:
                            name = "150mm";
                            break;
                        case 3:
                            name = "100mm";
                            break;
                        case 4:
                            name = "50mm";
                            break;
                    }
                    break;
                //endregion
                //region----电压类型----
                case "电压类型":
                    switch (number)
                    {
                        case 1:
                            name = "高压";
                            break;
                        case 2:
                            name = "中压";
                            break;
                        case 3:
                            name = "低压";
                            break;
                    }
                    break;
                //endregion
                //region----电压等级----
                case "电压等级":
                    switch (number)
                    {
                        case 1:
                            name = "交流10kV";
                            break;
                        case 2:
                            name = "交流20kV";
                            break;
                        case 3:
                            name = "交流35kV";
                            break;
                        case 4:
                            name = "交流110kV";
                            break;
                        case 5:
                            name = "交流220kV";
                            break;
                        case 6:
                            name = "无";
                            break;
                        case 7:
                            name = "光纤";
                            break;
                        case 8:
                            name = "其他";
                            break;
                        case 9:
                            name = "未定";
                            break;
                    }
                    break;
                //endregion
                //region----管沟状态----
                case "管沟状态":
                    switch (number)
                    {
                        case 1:
                            name = "未确认";
                            break;
                        case 2:
                            name = "确认";
                            break;
                    }
                    break;
                //endregion
                //region----是否----
                case "是否":
                    switch (number)
                    {
                        case 1:
                            name = "否";
                            break;
                        case 2:
                            name = "是";
                            break;
                    }
                    break;
                //endregion
                //region----有无----
                case "有无":
                    switch (number)
                    {
                        case 1:
                            name = "无";
                            break;
                        case 2:
                            name = "有";
                            break;
                    }
                    break;
                //endregion
                //region----管径材料----
                case "管径材料":
                    switch (number)
                    {
                        case 1:
                            name = "未定";
                            break;
                        case 2:
                            name = "砼";
                            break;
                        case 3:
                            name = "铁";
                            break;
                        case 4:
                            name = "PVC";
                            break;
                        case 5:
                            name = "维纶";
                            break;
                        case 6:
                            name = "其他";
                            break;
                    }
                    break;
                //endregion
                //region----管径----
                case "管径":
                    switch (number)
                    {
                        case 1:
                            name = "未定";
                            break;
                        case 2:
                            name = "100mm";
                            break;
                        case 3:
                            name = "150mm";
                            break;
                        case 4:
                            name = "200mm";
                            break;
                        case 5:
                            name = "250mm";
                            break;
                        case 6:
                            name = "300mm";
                            break;
                        case 7:
                            name = "其他";
                            break;
                    }
                    break;
                //endregion
                //region----运行状态----
                case "运行状态":
                    switch (number)
                    {
                        case 1:
                            name = "在运";
                            break;
                        case 2:
                            name = "运行";
                            break;
                        case 3:
                            name = "设计";
                            break;
                        case 4:
                            name = "施工";
                            break;
                        case 5:
                            name = "备用";
                            break;
                        case 6:
                            name = "退役";
                            break;
                        case 7:
                            name = "其他";
                            break;
                        case 8:
                            name = "未投运";
                            break;
                        case 9:
                            name = "退运";
                            break;
                        case 10:
                            name = "现场留用";
                            break;
                        case 11:
                            name = "库存留用";
                            break;
                        case 12:
                            name = "待报废";
                            break;
                        case 13:
                            name = "报废";
                            break;
                    }
                    break;
                //endregion
                //region----结构形式----
                case "结构形式":
                    switch (number)
                    {
                        case 1:
                            name = "未定";
                            break;
                        case 2:
                            name = "砖混";
                            break;
                        case 3:
                            name = "方沟";
                            break;
                        case 4:
                            name = "单衬";
                            break;
                        case 5:
                            name = "双衬";
                            break;
                        case 6:
                            name = "盾构";
                            break;
                        case 7:
                            name = "顶管";
                            break;
                        case 8:
                            name = "其他";
                            break;
                    }
                    break;
                //endregion
                //region----悬挂方式----
                case "悬挂方式":
                    switch (number)
                    {
                        case 1:
                            name = "未定";
                            break;
                        case 2:
                            name = "支架";
                            break;
                        case 3:
                            name = "涨圈";
                            break;
                        case 4:
                            name = "挂钩";
                            break;
                        case 5:
                            name = "其他";
                            break;
                    }
                    break;
                //endregion
                //region----资产性质----
                case "资产性质":
                    switch (number)
                    {
                        case 1:
                            name = "国家电网公司";
                            break;
                        case 2:
                            name = "区域电网公司";
                            break;
                        case 3:
                            name = "省（直辖市、自治区）公司";
                            break;
                        case 4:
                            name = "县公司";
                            break;
                        case 5:
                            name = "用户";
                            break;
                        case 6:
                            name = "股份制";
                            break;
                    }
                    break;
                //endregion
                //region----专业类型----
                case "专业类型":
                    switch (number)
                    {
                        case 1:
                            name = "输电";
                            break;
                        case 2:
                            name = "变电";
                            break;
                        case 3:
                            name = "配电";
                            break;
                    }
                    break;
                //endregion
                //region----通道数----
                case "通道数":
                    switch (number)
                    {
                        case 1:
                            name = "未定";
                            break;
                        case 2:
                            name = "一通井";
                            break;
                        case 3:
                            name = "二通井";
                            break;
                        case 4:
                            name = "三通井";
                            break;
                        case 5:
                            name = "四通井";
                            break;
                        case 6:
                            name = "异形井";
                            break;
                        case 7:
                            name = "其他";
                            break;
                    }
                    break;
                //endregion
                //region----井盖材料----
                case "井盖材料":
                    switch (number)
                    {
                        case 1:
                            name = "未定";
                            break;
                        case 2:
                            name = "球磨";
                            break;
                        case 3:
                            name = "铁";
                            break;
                        case 4:
                            name = "砼";
                            break;
                        case 5:
                            name = "复合材料";
                            break;
                        case 6:
                            name = "聚酯";
                            break;
                        case 7:
                            name = "其他";
                            break;
                    }
                    break;
                //endregion
                //region----井盖类型----
                case "井盖类型":
                    switch (number)
                    {
                        case 1:
                            name = "未定";
                            break;
                        case 2:
                            name = "圆形";
                            break;
                        case 3:
                            name = "方形";
                            break;
                        case 4:
                            name = "其他";
                            break;
                    }
                    break;
                //endregion
                case "拐点类型":
                    switch (number)
                    {
                        case 1:
                            name = "低压电子标签";
                            break;
                        case 2:
                            name = "拐点";
                            break;
                    }
                    break;
            }
            return name;
        }

       static public String getshebei(String name)
        {
            String number = "";
            switch (name)
            {
                case "BDZ":
                    number = "0";
                    break;
                case "BYQ":
                    number = "1";
                    break;
                case "FZX":
                    number = "2";
                    break;
                case "GT":
                    number = "3";
                    break;
                case "HWG":
                    number = "4";
                    break;
                case "KGZ":
                    number = "5";
                    break;
                case "PDS":
                    number = "6";
                    break;
                case "XB":
                    number = "7";
                    break;
                case "XNSB":
                    number = "8";
                    break;
                case "SBGD":
                    number = "9";
                    break;
                case "DLJ":
                    number = "10";
                    break;
                case "RFID":
                    number = "11";
                    break;
            }
            return number;
        }

       static public String gettdnum(String nummber)
        {
            String name = "";
            switch (nummber)
            {
                case "0":
                    name = "DG";
                    break;
                case "1":
                    name = "GD";
                    break;
                case "2":
                    name = "QTMS";
                    break;
                case "3":
                    name = "PG";
                    break;
                case "4":
                    name = "QJ";
                    break;
                case "5":
                    name = "SD";
                    break;
                case "6":
                    name = "XNGG";
                    break;
                case "7":
                    name = "ZM";
                    break;
            }
            return name;
        }
       static public String gettdtype(String name)
        {
            String number = "";
            switch (name)
            {
                case "DG":
                    number = "0";
                    break;
                case "GD":
                    number = "1";
                    break;
                case "QTMS":
                    number = "2";
                    break;
                case "PG":
                    number = "3";
                    break;
                case "QJ":
                    number = "4";
                    break;
                case "SD":
                    number = "5";
                    break;
                case "XNGG":
                    number = "6";
                    break;
                case "ZM":
                    number = "7";
                    break;
            }
            return number;
        }


    }
}
